package com.suxin.prometheus.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname HelloController
 * @Description [ TODO ]
 * @Author Tang
 * @Date 2020/10/13 21:45
 * @Created by ASUS
 */
@RestController
public class HelloController {

    @GetMapping("/index")
    public String index() {
        return "index...";
    }

    @GetMapping("/run")
    public String run() {
        for (int i = 1 ; i <= 10 ; i++) {
            Thread t = new Thread(() -> {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            } , "HelloThread - " + i);
            t.start();
        }
        return "run...";
    }
}